#!/bin/bash

#$1 - directory path with last /
#$2 - groupId
#$3 - version
#$4 - package
#$5 - install file name
#example install spring library: ./makeMavenIntaller.sh ./spring3.0/ org.springframework 3.0.0.M2 jar install.sh
#file in directory must be without version


#Create bach prolog in script file
echo "#!/bin/bash" >> $5

#Gets library from directory

ls -C $1 | while read lib
do
	echo "mvn install:install-file  -Dfile=$1$lib -DgroupId=$2 -DartifactId=$lib -Dversion=$3 -Dpackaging=$4" >> $5
done

#Set execute flag
chmod +x $5
